package com.foreknow.demo2.Test5;

public class Rect extends Shape {
    private double width;
    private double height;

    public double getWidth() {
        return width;
    }

    public void setWidth(double width) {
        this.width = width;
    }

    public double getHeight() {
        return height;
    }

    public void setHeight(double height) {
        this.height = height;
    }
    @Override
    public double getArea(){
        return width * height;
    }
    public double getArea(double radius){
        return 3.14*radius*radius;
    }

    public static void main(String[] args) {
        Rect rect = new Rect();
        rect.setWidth(10);
        rect.setHeight(20);
        double area1 = rect.getArea();
        System.out.println(area1);
        double area2 = rect.getArea(10);
        System.out.println(area2);
    }
}
